package com.bwie.parkdemo.adapter;

import android.graphics.Color;
import android.support.annotation.NonNull;
import android.util.Log;
import android.widget.ImageView;

import com.bwie.parkdemo.R;
import com.bwie.parkdemo.mvvm.model.entity.CarColorEntity;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

/**
 * 车位申请界面中的车辆颜色
 * */
public class ColorAdapter  extends BaseQuickAdapter<Object, BaseViewHolder> {

    public static final int TYPE = 1;

    public ColorAdapter() {
        super(R.layout.item_color);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, Object item) {
        Log.e("ZXY","ColorAdapter:"+getItemCount());
        CarColorEntity.Values values = (CarColorEntity.Values) item;
        ImageView img = helper.getView(R.id.item_color_img);
        img.setBackgroundColor(Color.parseColor(values.colorValue));
    }
}
